/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stdio.h"
#include "stdarg.h"
#include "string.h"
#include "math.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
#define SystemVersion 1098
#define PowerOffTime 500
#define BatScanTime 1000
#define LEDScanTime 20
#define KeyScanTime 10
#define LCDRufusTime 10
#define XbeeRecScanTime 50
#define XbeeSendTime  10
#define XbeeSendTickTime  50
#define EC11ScanTime 100

#define LcdDisplayRufusTime 100
#define LEDChargrTime 100
#define FeedDogTime 800
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define PC1_Pin GPIO_PIN_1
#define PC1_GPIO_Port GPIOC
#define PC2_Pin GPIO_PIN_2
#define PC2_GPIO_Port GPIOC
#define PC3_Pin GPIO_PIN_3
#define PC3_GPIO_Port GPIOC
#define PA0_Pin GPIO_PIN_0
#define PA0_GPIO_Port GPIOA
#define PC4_Pin GPIO_PIN_4
#define PC4_GPIO_Port GPIOC
#define PC5_Pin GPIO_PIN_5
#define PC5_GPIO_Port GPIOC
#define PB1_Pin GPIO_PIN_1
#define PB1_GPIO_Port GPIOB
#define PB2_Pin GPIO_PIN_2
#define PB2_GPIO_Port GPIOB
#define PB10_Pin GPIO_PIN_10
#define PB10_GPIO_Port GPIOB
#define PB11_Pin GPIO_PIN_11
#define PB11_GPIO_Port GPIOB
#define PowerOn_Pin GPIO_PIN_8
#define PowerOn_GPIO_Port GPIOC
#define KeyOn_Pin GPIO_PIN_9
#define KeyOn_GPIO_Port GPIOC
#define PD2_Pin GPIO_PIN_2
#define PD2_GPIO_Port GPIOD
#define PB8_Pin GPIO_PIN_8
#define PB8_GPIO_Port GPIOB
#define PB9_Pin GPIO_PIN_9
#define PB9_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */
#define ReadZadd        HAL_GPIO_ReadPin(PC1_GPIO_Port,PC1_Pin)
#define ReadZsub        HAL_GPIO_ReadPin(PC2_GPIO_Port,PC2_Pin)
#define ReadPauseKey    HAL_GPIO_ReadPin(PC3_GPIO_Port,PC3_Pin)
#define ReadYsub        HAL_GPIO_ReadPin(PC4_GPIO_Port,PC4_Pin)
#define ReadXsub        HAL_GPIO_ReadPin(PC5_GPIO_Port,PC5_Pin)
#define ReadXadd        HAL_GPIO_ReadPin(PB1_GPIO_Port,PB1_Pin)
#define ReadYadd        HAL_GPIO_ReadPin(PB2_GPIO_Port,PB2_Pin)
#define ReadLeveladd    HAL_GPIO_ReadPin(PB8_GPIO_Port,PB8_Pin)
#define ReadLevelsub    HAL_GPIO_ReadPin(PB9_GPIO_Port,PB9_Pin)
#define ReadJointadd    HAL_GPIO_ReadPin(PB10_GPIO_Port,PB10_Pin)
#define ReadJointsub    HAL_GPIO_ReadPin(PB11_GPIO_Port,PB11_Pin)
#define ReadModeKey     HAL_GPIO_ReadPin(PD2_GPIO_Port,PD2_Pin)
#define ReadCharge      HAL_GPIO_ReadPin(PA0_GPIO_Port,PA0_Pin)
#define KeyPress 0
#define KeyOpen  1
/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
